const koa=require('koa')
const views=require('koa-views')
const bodyParser=require('koa-bodyparser')
const app=new koa()
const PORT = process.env.PORT || 4000;
const InitManager=require('./src/core/init')

app.use(require('koa-static')(__dirname+'/public'))
app.use(
    bodyParser({
        enableTypes:['json','form','text']
    })
)
app.use(views(__dirname+'/src/views',{
    extension:'ejs'
}))

// service abstract
InitManager.initCore(app)

app.listen(PORT,()=>{
    console.log('koa启动在'+PORT+'端口')
})